package com.ymttest.database.sqlwapper.hunter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.hunter.HunterSettlementSalesDetail;

public class HunterSettlementSalesDetailWrapper {
	
	SqlManager manager;

    public HunterSettlementSalesDetailWrapper() {
        manager = new SqlManager("tradingsettlement");
    }
    
    @SuppressWarnings("unchecked")
	public List<HunterSettlementSalesDetail> selectBySettlementId(String settlementId) {
    	
    	List<HunterSettlementSalesDetail> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.hunter.HunterSettlementSalesDetailMapper.selectBySettlementId",
                        settlementId);
        manager.commit();
        
		if (result.size() == 0) {
			Logger.comment("hunter_settlement_sales_detail没有数据");
		}
		
		return result;
    }
    
    @SuppressWarnings("unchecked")
	public HunterSettlementSalesDetail selectBySettlementIdAndCatalogId(String settlementId, String catalogId) {
    	
    	Map<String, String> map = new HashMap<String, String>();
    	
    	map.put("settlementId", settlementId);
    	map.put("catalogId", catalogId);
    	
    	List<HunterSettlementSalesDetail> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.hunter.HunterSettlementSalesDetailMapper.selectBySettlementIdAndCatalogId",
                        map);
        manager.commit();
        
		if (result.size() == 0) {
			Logger.comment("hunter_settlement_sales_detail没有数据");
		}
		
		return result.get(0);
    }
	
    public static void main(String[] args) {
    	
    	HunterSettlementSalesDetailWrapper test = new HunterSettlementSalesDetailWrapper();
    	
    	System.out.println(test.selectBySettlementIdAndCatalogId("N_FJY2019062768948", "c3252617").getProduct_type());
    }
}
